import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

public class map {
    public static void main(String[] args) {
        Map<String,String> map = new TreeMap<>();
        map.put("及时雨","松江");
        map.put("齐天大圣","孙悟空");

        Set<Map.Entry<String,String>> entries = map.entrySet();
        System.out.println(entries);
        for (Map.Entry<String,String> entry : entries){
            System.out.println(entry);
        }

        for (Map.Entry<String,String> entry : entries){
            System.out.println("Key:"+entry.getKey()+" Value:"+entry.getValue());
        }



        /*Set<String> set = map.keySet();
        System.out.println(set);
        System.out.println(map.get("齐天大圣"));

        String val = map.get("齐天大圣");
        String val2 = map.get("孙悟空");
        System.out.println(val);
        System.out.println(val2);

        String val3 = map.remove("齐天大圣");
        System.out.println(val3);

        String val4 = map.get("齐天大圣");
        System.out.println(val4);*/
    }
}
